package com.liu.sx.controller;

import com.liu.sx.common.entity.PageResult;
import com.liu.sx.common.entity.Result;
import com.liu.sx.common.status.CodeEnum;
import com.liu.sx.entity.Pay;
import com.liu.sx.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 充值卡 充值记录
 */
@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
   private PayService payService;


   @GetMapping()
   public Result list(int page,int rows,String query){

      Page<Pay> pages =payService.findAll(page,rows,query);
       return  new Result(true, CodeEnum.OK.getCode(),"查询成功",new PageResult<Pay>(pages.getTotalElements(),pages.getContent()));
   }




}
